<?php

require_once 'cms/menu/om/om/BaseMenu.php';


/**
 * Skeleton subclass for representing a row from the 'menu' table.
 *
 * 
 *
 * You should add additional methods to this class to meet the
 * application requirements.  This class will only be generated as
 * long as it does not already exist in the output directory.
 *
 * @package menu.om
 */	
class Menu extends BaseMenu {

    private $count;

    public function getRootItems($lang) {
        require_once 'MenuItemPeer.php';
        require_once 'MenuItemI18nPeer.php';
        $c = new Criteria();
        $c->add(MenuItemI18nPeer::LANGUAGE_CODE, $lang);
        $c->add(MenuItemPeer::MENU_ID, $this->getMenuId());
        $c->add(MenuItemPeer::PARENT_ID, null);
        $c->addJoin(MenuItemI18nPeer::MENU_ITEM_ID, MenuItemPeer::MENU_ITEM_ID);
        $c->addAscendingOrderByColumn(MenuItemPeer::POSITION);
        return MenuItemI18nPeer::doSelect($c);
    }

    public function getCount() {
        return $this->count;
    }

    public function setCount($count) {
        $this->count = $count;
    }

    public function hydrate(ResultSet $rs, $startcol = 1)
    {
        $startcol = parent::hydrate($rs, $startcol);

        try {
            $this->count = $rs->getInt($startcol);
        } catch(Exception $e) {
            ;
        }
    }

} // Menu
